<div class="col-12">
    <div class="card">
        <div class="card-header">
            <h3 class="card-title">{{.label }}</h3>

            <div class="card-tools">

                <div class="input-group input-group-sm" style="width: 250px;">
                    <a  class="btn btn-success btn-sm"  data-toggle="modal" data-target="#addRoleModal">
                        <i class="fa fa-plus "></i>
                    </a>
                    <input id="search-role" type="text" name="table_search" class="form-control float-right" placeholder="Search" value="{{ .key }}">
                    <div class="input-group-append">
                        <a type="submit" class="btn btn-default" id="search-role-a">
                            <i class="fa fa-search" style="color: grey"></i>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.card-header -->
        <div class="card-body table-responsive p-0">
            <table class="table table-hover text-nowrap">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>名称</th>
                    <th>备注</th>
                    <th>授权</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {{ range  .role_list }}
                <tr>
                    <td>{{ .ID }}</td>
                    <td>{{ .RoleName }}</td>
                    <td>{{ .RoleMsg }}</td>
                    <td>
                        <a class="btn btn-xs btn-info" roleid="{{ .ID }}" name="perms">权限</a>
                        <a class="btn btn-xs btn-info" roleid="{{ .ID }}" name="platform">平台</a>
                        <a class="btn btn-xs btn-info" roleid="{{ .ID }}" name="asset">资产</a>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-info" roleid="{{ .ID }}" name="edit-role"  data-toggle="tooltip" data-placement="top" title="修改">
                            <span class="fa fa-edit"></span>
                        </a>
                        <a class="btn btn-xs btn-danger" roleid="{{ .ID }}" name="del-role" data-toggle="tooltip" data-placement="top" title="删除">
                            <span class="fa fa-trash"></span>
                        </a>
                    </td>
                </tr>

                {{end}}

                </tbody>
            </table>
        </div>
        <!-- /.card-body -->
        <div class="card-footer clearfix">
            <ul class="pagination pull-right" style="margin-right: 50px">
                {{if eq $.page.CurPage 1 }}
                    <li class="page-item disabled"><a class="page-link" href="/log/user/1/">首页</a></li>
                    <li class="page-item disabled"><a class="page-link disabled" href="/log/user/{{ Sub $.page.CurPage 1 }}/">上一页</a></li>
                {{ else }}
                    <li class="page-item"><a class="page-link" href="/log/user/1/">首页</a></li>
                    <li class="page-item"><a class="page-link" href="/log/user/{{ Sub $.page.CurPage 1 }}/">上一页</a></li>
                {{ end }}
                </li>

                {{range $k,$v:=.page.Nums}}
                    <li class="page-item"><a class="page-link {{if eq $v $.page.CurPage}}active{{end}}" href="/log/user/{{$v}}/">{{ $v }}</a></li>
                    </li>
                {{end}}

                {{if eq $.page.CurPage .page.PageCount }}
                    <li class="page-item disabled"><a class="page-link" href="/log/user/{{ Add $.page.CurPage 1 }}/">下一页</a></li>
                    <li class="page-item disabled"><a class="page-link" href="/log/user/{{.page.PageCount }}/">尾页</a></li>
                {{ else }}
                    <li class="page-item"><a class="page-link" href="/log/user/{{ Add $.page.CurPage 1 }}/">下一页</a></li>
                    <li class="page-item"><a class="page-link" href="/log/user/{{.page.PageCount }}/">尾页</a></li>
                {{ end }}
            </ul>
        </div>
    </div>
    <!-- /.card -->
</div>

<!--模态框-->
<!--添加角色-->
<div class="modal fade" id="addRoleModal" tabindex="-1" role="dialog" aria-labelledby="addRoleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header color-back">
                <h6 class="modal-title pull-left" id="addRoleModalLabel">添加</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: white;font-family: -webkit-pictograph;">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">

                <div class="form-group row">
                    <label  class="col-sm-3">角色名</label>
                    <input type="text" class="form-control my-radius" placeholder="角色名" id="rolename">
                </div>
                <div class="form-group row">
                    <label  class="col-sm-3">备注</label>
                    <input type="text" class="form-control my-radius" placeholder="备注" id="rolemsg">
                </div>

            </div>

            <div class="modal-footer color-gray">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-info" id="add-role-sub">提交</button>
            </div>
        </div>
    </div>
</div>
<!--/添加角色-->

<!--修改角色-->
<div class="modal fade" id="editRoleModal" tabindex="-1" role="dialog" aria-labelledby="editRoleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header color-back">
                <h6 class="modal-title pull-left" id="editRoleModalLabel">修改</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: white;font-family: -webkit-pictograph;">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">

                <div class="form-group row">
                    <label  class="col-sm-3">角色名</label>
                    <input type="text" class="form-control my-radius" placeholder="角色名" id="edit-rolename">
                </div>
                <div class="form-group row">
                    <label  class="col-sm-3">备注</label>
                    <input type="text" class="form-control my-radius" placeholder="备注" id="edit-rolemsg">
                </div>

            </div>

            <div class="modal-footer color-gray">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-info" id="edit-role-sub">提交</button>
            </div>
        </div>
    </div>
</div>
<!--/修改角色-->


<div class="modal fade" id="PermsModal" tabindex="-1" role="dialog" aria-labelledby="PermsModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="width: 900px">
            <div class="modal-header color-back">
                <h6 class="modal-title pull-left" id="PermsModalLabel">菜单授权</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: white;font-family: -webkit-pictograph;">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <ul class="list-unstyled">
                    <li name="level1-menu">
                        <div class="checkbox checkbox-primary">
                            <input type="checkbox" id="checkbox-all" name="all">
                            <label for="checkbox-all">
                                全选
                            </label>
                        </div>
                    </li>
                    <ul class="list-unstyled" id="perms-tree">
                        {{range .menu_list}}
                            <li name="level1-menu">
                                <div class="checkbox checkbox-primary">
                                    <input type="checkbox" id="{{ .ID }}" Pid="0" value="{{ .ID }}"  name="level1-menu">
                                    <label for="{{ .ID }}">
                                        {{ .MenuTitle }}
                                    </label>
                                </div>
                                <ul class="list-unstyled" name="level2-menu" style="margin-left: 20px;">
                                {{ range .MenuLevel }}
                                    <li >
                                        <div class="checkbox checkbox-primary">
                                            <input type="checkbox" id="{{ .ID }}" Pid="{{ .PMenu }}" value="{{ .ID }}" name="level2-menu">
                                            <label for="{{ .ID }}">
                                                {{ .MenuTitle }}
                                            </label>
                                        </div>
                                        <ul class="list-inline" name="level3-menu" style="margin-left: 20px;margin-bottom: 10px">
                                            {{ range .CMenus }}
                                                <li>
                                                    <div class="checkbox checkbox-primary">
                                                        <input type="checkbox" id="{{ .ID }}" Pid="{{ .PMenu }}" value="{{ .ID }}" name="level3-menu">
                                                        <label for="{{ .ID }}">
                                                            {{ .MenuTitle }}
                                                        </label>
                                                    </div>
                                                </li>
                                            {{ end }}
                                        </ul>
                                    </li>
                                {{ end }}
                                </ul>
                            </li>
                        {{ end }}
                    </ul>
                </ul>
            </div>

            <div class="modal-footer color-gray">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-info" id="edit-role-perms-sub">提交</button>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="pfmModal" tabindex="-1" role="dialog" aria-labelledby="pfmModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="pfmModalLabel">平台授权</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
            </div>
            <div class="modal-body">
                <ul id="treeDemo" class="ztree"></ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="pfm-sub">提交</button>
            </div>
        </div>
    </div>
</div>

<!--/模态框-->

